import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
// import { Http} from '@angular/http';

/**
 * Generated class for the LicenseagentPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-licenseagent',
  templateUrl: 'licenseagent.html',
})
export class LicenseagentPage {

  //定义用于登录的Login对象，属性默认值为空，双向绑定获得
  login: { licensename: string, phone: string } = {
    licensename: '',
    phone: '',
  };
  public riskList = {};
  constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.riskList = {
      "zclist" : [
        {"id":"01","subTitle" : "1.公司名称核准", "content" :["名称不合规无法注册"],"btnText" : "取名规范咨询"},
        {"id":"02","subTitle" : "2.确认注册地址", "content" :["70%公司因地址被驳回"],"btnText" : "无注册地址须知"},
        {"id":"03","subTitle" : "3.确认经营范围", "content" :["需按工商标准填写"],"btnText" : "范围目录下载"},
        {"id":"04","subTitle" : "4.确认注册资金", "content" :["无需实际缴纳验资"],"btnText" : "资金填写指导"},
        {"id":"05","subTitle" : "5.提交资料", "content" :["将确认的相关资料提交"],"btnText" : "办理时长咨询"}
      ],
      "list" : [
        {"id":"01","subTitle" : "个体户执照办理", "content" :["个体户办理一门请","是否可以办理一键通"],"iconUrl":"../../assets/imgs/yyzz/icon1@2x.png","btnText" : "免费咨询"},
        {"id":"02","subTitle" : "企业执照办理", "content" :["中禄提供稳定地址","后期财务专业服务"],"iconUrl":"../../assets/imgs/yyzz/icon2@2x.png","btnText" : "免费咨询"},
        {"id":"03","subTitle" : "住宅能否注册公司", "content" :["住宅注册公司特殊入","口，每日仅30名额"],"iconUrl":"../../assets/imgs/yyzz/icon3@2x.png","btnText" : "免费咨询"},
        {"id":"04","subTitle" : "特殊资质行业公司注册", "content" :["道路运输、劳务派遣、","房产中介、美容院..."],"iconUrl":"../../assets/imgs/yyzz/icon4@2x.png","btnText" : "免费咨询"},
        {"id":"05","subTitle" : "无地址注册", "content" :["无地址注册、农村房产","能否注册？"],"iconUrl":"../../assets/imgs/yyzz/icon5@2x.png","btnText" : "免费咨询"}
      ],

    };


  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad LicenseagentPage');
  }
  isNull(str) {
    if(str === "" || str == undefined)
      return true;
    var regu = "^[ ]+$";
    var re = new RegExp(regu);
    return re.test(str);
  }
  checkMobile(str) { //写一个判断函数
    var re = /^1\d{10}$/ //正则表达式
    if(re.test(str)) { //判断字符是否是11位数字
      return true;
    } else {
      return false;
    }
  }
  getDataFromURL() {
    if (this.isNull(this.login.phone) || !this.checkMobile(this.login.phone)) {//判断是否符合手机格式，并且不为空
      console.log('手机格式正确');
      return;
    }
  }

}
